package com.gsj.lx.mybatislx.impl;

import com.gsj.lx.mybatislx.config.SqlUtils;
import com.gsj.lx.mybatislx.dao.UserService;
import com.gsj.lx.mybatislx.mapper.UserMapper;
import com.gsj.lx.mybatislx.model.MyUser;
import com.gsj.lx.mybatislx.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: mybatislx
 * @description:
 * @author: 郭书江
 * @create: 2022-05-20 15:46
 **/
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;
    @Override
    public User getUserOne(Long id,String username) {
        User one = userMapper.getOne(id,username);
        return one;
    }

    @Override
    public List<MyUser> getMyUserAll() throws Exception {
        MyUser myUser = new MyUser();
        String sql = SqlUtils.selectseek(myUser);

        List<MyUser> all = userMapper.getMyUserAll(sql);
        return all;
    }
}
